#!/usr/bin/env python

import tornado

import tornado.ioloop
import tornado.web

import sys
import os
import os.path

handlerPath = os.path.join(os.path.abspath(os.path.dirname(__file__)),"handler")
storagePath = os.path.join(os.path.abspath(os.path.dirname(__file__)),"storage")
authPath = os.path.join(os.path.abspath(os.path.dirname(__file__)),"auth")
commPath = os.path.join(os.path.abspath(os.path.dirname(__file__)),"common")


sys.path.append(handlerPath)
sys.path.append(storagePath)
sys.path.append(authPath)
sys.path.append(commPath)

import router

PORT = 8088
IP   = "127.0.0.1"

app = tornado.web.Application(router.Router)

def StartWebSvr():
    app.listen(PORT,address=IP)
    tornado.ioloop.IOLoop.instance().start()


if __name__ == "__main__":
    StartWebSvr()
    
